package com.yl.common.domain.base.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @Description: 图表对象 支持饼图、仪表图、环形图
 * @author: liangjian
 * @created: 2021年12月30日16:15:56
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "Echarts2VO", description = "图表对象 支持饼图、仪表图、环形图")
public class Echarts2VO {

    public Echarts2VO(){}

    public Echarts2VO(String type){
        this.type = type;
    }

    public Echarts2VO(String type,List<Echarts2SeriesVO> data){
        this.type = type;
        this.data = data;
    }

    @ApiModelProperty(value="图表类型 pie饼图 gauge仪表图 ring环形图")
    @JsonProperty("type")
    private String type;

    @ApiModelProperty(value="图表data数据")
    @JsonProperty("data")
    private List<Echarts2SeriesVO> data;


    /*
    根据前端要求 返回的数据示例
    {
        "type": "pie",
        "data": [
            {
                "name": "用户正常打卡人数",
                "nameKey": "用户正常打卡人数-唯一标识",
                "value": 100
            },
            {
                "name": "用户异常打卡人数",
                "type": "用户异常打卡人数-唯一标识",
                "data": 3
            }
        ]
    }
    */



    @Getter
    public enum EnumType {
        PIE("pie","饼图"),
        GAUGE("gauge","仪表图"),
        RING("ring","环形图");

        private String type;
        private String typeName;

        EnumType(String type,String typeName) {
            this.type = type;
            this.typeName = typeName;
        }
    }











}
